#!/usr/bin/python3
import sys

class Decoder:
    def __init__(self, width):
        self.width = width
        self.ones = [0] * width
        self.zeroes = [0] * width
        self.gamma_rate = 0
        self.epsilon_rate = 0

    def decode_line(self, line):
        assert len(line) == self.width
        for i in range(len(line)):
            self.zeroes[i] += 1 - int(line[i])
            self.ones[i] += int(line[i])

    def finalize(self):
        assert len(self.ones) == len(self.zeroes)
        length = len(self.ones)
        for i in range(length):
            self.gamma_rate += (1 if self.ones[i] > self.zeroes[i] else 0) * 2 ** (length - i - 1)
            self.epsilon_rate += (1 if self.zeroes[i] > self.ones[i] else 0) * 2 ** (length - i - 1)

# annoying first pass to init list
line = input()
dec = Decoder(len(line))
dec.decode_line(line)
for line in sys.stdin:
    line = line.rstrip('\n')
    dec.decode_line(line)

dec.finalize()
print(dec.gamma_rate, dec.epsilon_rate, dec.gamma_rate * dec.epsilon_rate)